<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="stripes" uri="http://stripes.sourceforge.net/stripes.tld"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Welcome to ISERN</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link href="default.css" rel="stylesheet" type="text/css" />
</head>
<body>

<div id="outer">
  <div id="header">
    <h1>ISERN Sanity Check Report</h1>
  </div>
  <div id="menu">
    <ul>
      <li class="first"><stripes:link href="/mainMenu.jsp">Home</stripes:link></li>
      <li><stripes:link href="/prefuse.jsp">Prefuse</stripes:link></li>
      <li><stripes:link href="/MyIsern.action" event="sanityCheckReport">Sanity</stripes:link></li>
	  <li><stripes:link href="Logout.action" event="logout" >Logout</stripes:link><li>
    </ul>
    <div class="clear"></div>
  </div>
  <div id="content">
   
    <div id="secondaryContent">
      <h3>Display Entries<span></span></h3>
        <ul>
            <li><stripes:link href="/Display.action" event="printResearchers">Display Researchers</stripes:link></li>
            <li><stripes:link href="/Display.action" event="printOrganizations">Display Organizations</stripes:link></li>
            <li><stripes:link href="/Display.action" event="printCollaborations">Display Collaborations</stripes:link></li>  
        </ul>
      <h3>Add Entries<span></span></h3>
      <ul>
             <li><stripes:link href="/Display.action" event="addResearcher">Add New Researcher</stripes:link></li>
             <li><stripes:link href="/addOrganization.jsp">Add New Organization</stripes:link></li>
             <li><stripes:link href="/addCollaboration.jsp">Add New Collaboration</stripes:link></li>
      </ul>
      <h3>Edit Entries<span></span></h3>
      <ul>
              <li><stripes:link href="/Display.action" event="editResearcher">Edit Researcher</stripes:link></li>
              <li><stripes:link href="/Display.action" event="editOrganization">Edit Organization</stripes:link></li>
              <li><stripes:link href="/Display.action" event="editCollaboration">Edit Collaboration</stripes:link></li>
      </ul>
    </div>
	<div id="primaryContentContainer">
       <stripes:form id="FilterForm" action="/SanityCheck.action">
        Filter: 
          <stripes:select size="1" name="filterSetting">
            <stripes:option value="all">All</stripes:option>
            <stripes:option value="researchers">Researchers</stripes:option>
            <stripes:option value="organizations">Organizations</stripes:option>
            <stripes:option value="collaborations">Collaborations</stripes:option>
          </stripes:select>
        <stripes:form id="scReportForm" action="/SanityCheck.action">
          <stripes:submit value="Filter" name="filterReport"/>
        </stripes:form>
      </stripes:form>
    <hr>
    <table border="1" width="100%" class="sortable" id="sortable_id_1">
      <tr class="rowA">
        <th>Type</th>
        <th>Name</th>
        <th align="left">Errors</th>
      </tr>
      <%int count = 0;%>
      <c:forEach var="element" items="${actionBean.reportIterator}">
        <c:if test="${
          (element.type == \"Researcher\" && actionBean.checkResearchers) ||  
          (element.type == \"Organization\" && actionBean.checkOrganizations) ||
          (element.type == \"Collaboration\" && actionBean.checkCollaborations)
        }">
          <c:if test="${element.numErrors > 0}">
             <%count++;%>
             <tr class="rowB">
               <td style="padding: 3px" align="right">
                <c:if test="${element.type == \"Researcher\"}">
                  <div class="p1">
                </c:if>
                <c:if test="${element.type == \"Organization\"}">
                  <div class="p3">
                </c:if>
                <c:if test="${element.type == \"Collaboration\"}">
                  <div class="p5">
                </c:if>
                   ${element.type}
                 </div>
               </td>
               <td style="padding: 3px" align="left" width = "20%">
                  ${element.name}
               </td>
               <td style="padding: 3px" align="left" width="100%">
                 <table border="0" width="100%" class="sortable" id="sortable_id_2">
                   <c:forEach var="errorItem" items="${element.errorList}">
                     <tr><td>${errorItem}</td></tr>
                   </c:forEach>
                 </table>
               </td>
             </tr>
           </c:if>
        </c:if>
      </c:forEach>
    </table>
    <table border="0" width="100%" class="classcount">
      <tr class="rowA">
      <th>Total number of violations: <%=count%></th>
      </tr>
    </table>
   </div>

    <div class="clear"></div>
  </div>
  
  <div id="footer">
        <p>Copyright &copy; 2007 MyISERN-Onyx. Template Provided by <a rel="nofollow" target="_blank" href="http://www.freecsstemplates.org">Free CSS Templates</a></p>
  </div>
</div>
</body>
</html>